<%@ Page Language="C#" AutoEventWireup="true" CodeFile="temp.aspx.cs" Inherits="temp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server">
        </asp:GridView>
        <br />
        <br />
        &nbsp;<asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="TourID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="TourID" HeaderText="TourID" InsertVisible="False" ReadOnly="True"
                    SortExpression="TourID" />
                <asp:BoundField DataField="TourPackageID" HeaderText="TourPackageID" SortExpression="TourPackageID" />
                <asp:BoundField DataField="Startdate" HeaderText="Startdate" SortExpression="Startdate" />
                <asp:BoundField DataField="Enddate" HeaderText="Enddate" SortExpression="Enddate" />
                <asp:BoundField DataField="NumberOfSeats" HeaderText="NumberOfSeats" SortExpression="NumberOfSeats" />
                <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("TourID") %>'
                            OnClick="LinkButton1_Click">details</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:rnfCS %>"
            DeleteCommand="DELETE FROM [Tour] WHERE [TourID] = @TourID" InsertCommand="INSERT INTO [Tour] ([TourPackageID], [Startdate], [Enddate], [NumberOfSeats], [Status]) VALUES (@TourPackageID, @Startdate, @Enddate, @NumberOfSeats, @Status)"
            SelectCommand="SELECT * FROM [Tour]" UpdateCommand="UPDATE [Tour] SET [TourPackageID] = @TourPackageID, [Startdate] = @Startdate, [Enddate] = @Enddate, [NumberOfSeats] = @NumberOfSeats, [Status] = @Status WHERE [TourID] = @TourID">
            <DeleteParameters>
                <asp:Parameter Name="TourID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="TourPackageID" Type="Int32" />
                <asp:Parameter DbType="Date" Name="Startdate" />
                <asp:Parameter DbType="Date" Name="Enddate" />
                <asp:Parameter Name="NumberOfSeats" Type="Int32" />
                <asp:Parameter Name="Status" Type="Boolean" />
                <asp:Parameter Name="TourID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="TourPackageID" Type="Int32" />
                <asp:Parameter DbType="Date" Name="Startdate" />
                <asp:Parameter DbType="Date" Name="Enddate" />
                <asp:Parameter Name="NumberOfSeats" Type="Int32" />
                <asp:Parameter Name="Status" Type="Boolean" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
